package com.navinfo.tripanalysis.common.arithmetic.convert;

import com.navinfo.tripanalysis.common.arithmetic.common.OuterStatisticData;
import com.navinfo.tripanalysis.common.arithmetic.common.OuterStatisticExtendedData;
import org.bson.Document;

/**
 * 行程扩展数据与mongo数据库格式转换
 */
public class StatisticExtendedDataMongoConvert {
    /**
     * 行程Pojo转换为Document对象
     */
    public static Document toDocument(OuterStatisticData m) {
        Document doc = new Document();
        /*--start_schema*/
        if(m.getUid()!=null){ doc.put("uid",m.getUid());}
        if(m.getTid()!=null){ doc.put("tid",m.getTid());}
        if(m.getTripId()!=null){ doc.put("tripId",m.getTripId());}
        if(m.getRouteStartTime()!=null){ doc.put("routeSTime",m.getRouteStartTime());}
        if(m.getRouteEndTime()!=null){ doc.put("routeETime",m.getRouteEndTime());}

        OuterStatisticExtendedData e = m.getExtendedData();
        if(e.getRpmRange500Urea()!=null){ doc.put("rpmR500Ur",e.getRpmRange500Urea());}
        if(e.getRpmRange600Urea()!=null){ doc.put("rpmR600Ur",e.getRpmRange600Urea());}
        if(e.getRpmRange700Urea()!=null){ doc.put("rpmR700Ur",e.getRpmRange700Urea());}
        if(e.getRpmRange800Urea()!=null){ doc.put("rpmR800Ur",e.getRpmRange800Urea());}
        if(e.getRpmRange900Urea()!=null){ doc.put("rpmR900Ur",e.getRpmRange900Urea());}
        if(e.getRpmRange1000Urea()!=null){ doc.put("rpmR1000Ur",e.getRpmRange1000Urea());}
        if(e.getRpmRange1100Urea()!=null){ doc.put("rpmR1100Ur",e.getRpmRange1100Urea());}
        if(e.getRpmRange1200Urea()!=null){ doc.put("rpmR1200Ur",e.getRpmRange1200Urea());}
        if(e.getRpmRange1300Urea()!=null){ doc.put("rpmR1300Ur",e.getRpmRange1300Urea());}
        if(e.getRpmRange1400Urea()!=null){ doc.put("rpmR1400Ur",e.getRpmRange1400Urea());}
        if(e.getRpmRange1500Urea()!=null){ doc.put("rpmR1500Ur",e.getRpmRange1500Urea());}
        if(e.getRpmRange1600Urea()!=null){ doc.put("rpmR1600Ur",e.getRpmRange1600Urea());}
        if(e.getRpmRange1700Urea()!=null){ doc.put("rpmR1700Ur",e.getRpmRange1700Urea());}
        if(e.getRpmRange1800Urea()!=null){ doc.put("rpmR1800Ur",e.getRpmRange1800Urea());}
        if(e.getRpmRange1900Urea()!=null){ doc.put("rpmR1900Ur",e.getRpmRange1900Urea());}
        if(e.getRpmRange2000Urea()!=null){ doc.put("rpmR2000Ur",e.getRpmRange2000Urea());}
        if(e.getRpmRange2100Urea()!=null){ doc.put("rpmR2100Ur",e.getRpmRange2100Urea());}
        if(e.getRpmRange2200Urea()!=null){ doc.put("rpmR2200Ur",e.getRpmRange2200Urea());}
        if(e.getRpmRange2300Urea()!=null){ doc.put("rpmR2300Ur",e.getRpmRange2300Urea());}
        if(e.getRpmRange2400Urea()!=null){ doc.put("rpmR2400Ur",e.getRpmRange2400Urea());}
        if(e.getRpmRange2500Urea()!=null){ doc.put("rpmR2500Ur",e.getRpmRange2500Urea());}
        if(e.getRpmRange2600Urea()!=null){ doc.put("rpmR2600Ur",e.getRpmRange2600Urea());}
        if(e.getRpmRange2700Urea()!=null){ doc.put("rpmR2700Ur",e.getRpmRange2700Urea());}
        if(e.getRpmRange2800Urea()!=null){ doc.put("rpmR2800Ur",e.getRpmRange2800Urea());}
        if(e.getRpmRange2900Urea()!=null){ doc.put("rpmR2900Ur",e.getRpmRange2900Urea());}
        if(e.getRpmRange3000Urea()!=null){ doc.put("rpmR3000Ur",e.getRpmRange3000Urea());}
        if(e.getRpmRangeOver3000Urea()!=null){ doc.put("rpmRo3000Ur",e.getRpmRangeOver3000Urea());}
        if(e.getSpeedRange01Urea()!=null){ doc.put("speedR01Ur",e.getSpeedRange01Urea());}
        if(e.getSpeedRange02Urea()!=null){ doc.put("speedR02Ur",e.getSpeedRange02Urea());}
        if(e.getSpeedRange03Urea()!=null){ doc.put("speedR03Ur",e.getSpeedRange03Urea());}
        if(e.getSpeedRange04Urea()!=null){ doc.put("speedR04Ur",e.getSpeedRange04Urea());}
        if(e.getSpeedRange05Urea()!=null){ doc.put("speedR05Ur",e.getSpeedRange05Urea());}
        if(e.getSpeedRange06Urea()!=null){ doc.put("speedR06Ur",e.getSpeedRange06Urea());}
        if(e.getSpeedRange07Urea()!=null){ doc.put("speedR07Ur",e.getSpeedRange07Urea());}
        if(e.getSpeedRange08Urea()!=null){ doc.put("speedR08Ur",e.getSpeedRange08Urea());}
        if(e.getSpeedRange09Urea()!=null){ doc.put("speedR09Ur",e.getSpeedRange09Urea());}
        if(e.getSpeedRange10Urea()!=null){ doc.put("speedR10Ur",e.getSpeedRange10Urea());}
        if(e.getSpeedRange11Urea()!=null){ doc.put("speedR11Ur",e.getSpeedRange11Urea());}
        if(e.getSpeedRange12Urea()!=null){ doc.put("speedR12Ur",e.getSpeedRange12Urea());}
        if(e.getExceedSpeedRangeUrea()!=null){ doc.put("exceedSrUr",e.getExceedSpeedRangeUrea());}
        if(e.getTorque0Urea()!=null){ doc.put("torque0Ur",e.getTorque0Urea());}
        if(e.getTorque10Urea()!=null){ doc.put("torque10Ur",e.getTorque10Urea());}
        if(e.getTorque20Urea()!=null){ doc.put("torque20Ur",e.getTorque20Urea());}
        if(e.getTorque30Urea()!=null){ doc.put("torque30Ur",e.getTorque30Urea());}
        if(e.getTorque40Urea()!=null){ doc.put("torque40Ur",e.getTorque40Urea());}
        if(e.getTorque50Urea()!=null){ doc.put("torque50Ur",e.getTorque50Urea());}
        if(e.getTorque60Urea()!=null){ doc.put("torque60Ur",e.getTorque60Urea());}
        if(e.getTorque70Urea()!=null){ doc.put("torque70Ur",e.getTorque70Urea());}
        if(e.getTorque80Urea()!=null){ doc.put("torque80Ur",e.getTorque80Urea());}
        if(e.getTorque90Urea()!=null){ doc.put("torque90Ur",e.getTorque90Urea());}
        if(e.getTorque99Urea()!=null){ doc.put("torque99Ur",e.getTorque99Urea());}
        if(e.getTorque100Urea()!=null){ doc.put("torque100Ur",e.getTorque100Urea());}
        if(e.getGasOpenPercent0Urea()!=null){ doc.put("gasOp0Ur",e.getGasOpenPercent0Urea());}
        if(e.getGasOpenPercent10Urea()!=null){ doc.put("gasOp10Ur",e.getGasOpenPercent10Urea());}
        if(e.getGasOpenPercent20Urea()!=null){ doc.put("gasOp20Ur",e.getGasOpenPercent20Urea());}
        if(e.getGasOpenPercent30Urea()!=null){ doc.put("gasOp30Ur",e.getGasOpenPercent30Urea());}
        if(e.getGasOpenPercent40Urea()!=null){ doc.put("gasOp40Ur",e.getGasOpenPercent40Urea());}
        if(e.getGasOpenPercent50Urea()!=null){ doc.put("gasOp50Ur",e.getGasOpenPercent50Urea());}
        if(e.getGasOpenPercent60Urea()!=null){ doc.put("gasOp60Ur",e.getGasOpenPercent60Urea());}
        if(e.getGasOpenPercent70Urea()!=null){ doc.put("gasOp70Ur",e.getGasOpenPercent70Urea());}
        if(e.getGasOpenPercent80Urea()!=null){ doc.put("gasOp80Ur",e.getGasOpenPercent80Urea());}
        if(e.getGasOpenPercent90Urea()!=null){ doc.put("gasOp90Ur",e.getGasOpenPercent90Urea());}
        if(e.getGasOpenPercent99Urea()!=null){ doc.put("gasOp99Ur",e.getGasOpenPercent99Urea());}
        if(e.getGasOpenPercent100Urea()!=null){ doc.put("gasOp100Ur",e.getGasOpenPercent100Urea());}

        return doc;
    }
}
